#ifndef _Driver_H
#define _Driver_H

//#include "MCU_Cfg.h"
#include "Cpu.h"
#include "General.h"

typedef enum
{
	ePPWM1=0,
	ePPWM2,
	ePPWM3,
	ePPWM4,
	ePPWM5,
	ePPWM6,
	ePPWM7,
	ePPWM8,
	eSPWM,
	eDPWM,
	ePWMMAX,
}PWMType_E;


extern ftm_input_param_t flexTimer_ic1_InputCaptureConfig2;
extern uint8_t g_u8Diag_Databuff[16];
extern uint8_t g_u8Diag_Databuff_Right[16];
extern Trunk_Diag_Status_t g_Trunk_DiagStatus;
extern Fender_Diag_Status_t g_Fender_DiagStatus;
extern uint8_t g_u8Left_status;
extern uint8_t g_u8Right_status;
extern uint8_t g_u8Turn_status;
extern uint8_t g_u8Left_g_u8Board_lost_status;
extern uint8_t g_u8Right_g_u8Board_lost_status;
extern uint8_t g_u8Board_lost_status;


extern void Stop_On_Fender(void);

extern void Safety_LightOn(void);

extern void Stop_Off_Fender(void);

#if ((CURRENT_PROJECT  == PROJECT_Fender_Left)|| (CURRENT_PROJECT  == PROJECT_Fender_Right))

extern void PO_ALight_On(void);

extern void DI_ALight_On(void);

extern void DI_ALight_FlowOn(uint8_t led_position);

extern void DI_ALight_Off(void);

extern void PO_ALight_Off(void);

extern uint8_t Tail_ALight_ADC(void);

extern uint8_t Turn_ALight_ADC(void);

extern uint8_t Stop_ALight_ADC(void);

#endif

#if CURRENT_PROJECT  == PROJECT_trunk
extern void PO_Left_On(void);

extern void PO_Right_On(void);

extern void PO_Left_Off(void);

extern void PO_Right_Off(void);

extern void DI_On(uint8_t direction);

extern void DI_Off(uint8_t direction);

extern void DI_FlowOn(uint8_t direction, uint8_t led_position);

extern uint8_t Turn_Left_ADC(void);

extern uint8_t Turn_Right_ADC(void);

extern uint8_t Tail_Left_ADC(void);

extern uint8_t Tail_Right_ADC(void);

#endif

extern void Process_Diag_Result(uint8_t position);

extern void Judge_Diag_Data(uint8_t position);



#endif
